A multichannel detector has been constructed using a single avalanche photodiode and a fiber-loop delay line. Detection probabilities of the channels can be set using a variable-ratio coupler. The performance of the detector is demonstrated on its capability to distinguish multi-photon states (containing two or more photons) from the one-photon state and the vacuum state.